return {
  {
    "mason-org/mason.nvim",
    event = { "BufReadPre", "BufNewFile" },
    cmd = "Mason",
    dependencies = {
      "mason-org/mason-lspconfig.nvim",
    },
    config = function()
      require("mason").setup {
        install_root_dir = vim.fn.stdpath "data" .. "/mason",
        ui = {
          border = "rounded",
          icons = {
            package_installed = "✓",
            package_pending = "➜",
            package_uninstalled = "✗",
          },
        },
      }

      require("mason-lspconfig").setup {
        automatic_installation = true,
        ensure_installed = {
          "bashls",
          "yamlls",
          "jsonls",
          "taplo",
          "gopls",
          "vue_ls",
          "ts_ls",
          "html",
          "cssls",
          "tailwindcss",
          "svelte",
          "lua_ls",
          "graphql",
          "emmet_ls",
          "prismals",
          "pyright",
          "rust_analyzer",
        },
      }
    end,
  },
  {
    "neovim/nvim-lspconfig",
    enabled = true,
    event = { "BufReadPre", "BufNewFile" },
    dependencies = {
      "hrsh7th/cmp-nvim-lsp",
      -- neovim 的lsp 语法格式错误检测
      "folke/neodev.nvim",
      -- Lsp 的相关插件加载的工作进度
      "j-hui/fidget.nvim",
    },
    config = function()
      -- local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
      -- for type, icon in pairs(signs) do
      --   local hl = "DiagnosticSign" .. type
      --  -- 被弃用了 vim.fn.sign_define
      --   vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
      -- end
      local x = vim.diagnostic.severity
      vim.diagnostic.config {
        virtual_text = {
          -- source = "always",  -- Or "if_many"
          prefix = "■-> ", -- Could be '●', '■', '▎', 'x'
        },
        virtual_lines = false, --  多行诊断信息, 可以不设置, 使用插件trouble.nvim 在 buffer 中显示更加友好
        signs = {
          text = {
            -- [x.ERROR] = '',
            -- [x.WARN] = '',
            -- [x.INFO] = '',
            -- [x.HINT] = '󰌵',

            -- [x.ERROR] = '',
            -- [x.WARN] = '',
            -- [x.INFO] = '󰋇',
            -- [x.HINT] = '󰌵',

            [x.ERROR] = "✘",
            [x.WARN] = "",
            [x.HINT] = "⚑",
            [x.INFO] = "",
          },
        },
        underline = true,
        severity_sort = true,
        update_in_insert = true,
        float = {
          source = true, -- Or "if_many"
        },
      }

      -- neodev 与 fidget 必须在 lsp 配置服务之前设置
      -- lua 全局变量的识别,比如 vim 还有就是和 fidget 集成
      require("neodev").setup {
        library = {
          plugins = { "nvim-dap-ui" },
          types = true,
        },
      }
      -- fidget 必须在 lsp 配置服务之前设置
      require("fidget").setup()

      -- local lspconfig = require "lspconfig"
      local capabilities = require("cmp_nvim_lsp").default_capabilities()

      -- vim.tbl_deep_extend("keep", settings, {
      -- 	capabilities = blink.get_lsp_capabilities()
      -- })

      -- :help lspconfig-all
      vim.lsp.config("lua_ls", {
        cmd = { "lua-language-server" },
        filetypes = { "lua" },
        root_markers = { ".editorconfig", ".git", ".luarc.json", ".luarc.jsonc", vim.uv.cwd() },
        capabilities = capabilities,
        settings = {
          Lua = {
            runtime = {
              version = "LuaJIT",
            },
            workspace = {
              checkThirdParty = false,
              library = { vim.env.VIMRUNTIME, "${3rd}/luv/library" },
            },
          },
        },
      })
      vim.lsp.enable "lua_ls"

      vim.lsp.config("vue_ls", {
        capabilities = capabilities,
        -- add filetypes for typescript, javascript and vue
        filetypes = {
          "typescript",
          "javascript",
          "javascriptreact",
          "typescriptreact",
          "vue",
        },
        init_options = {
          vue = {
            -- disable hybrid mode
            hybridMode = true,
          },
        },
      })
      vim.lsp.enable "vue_ls"

      vim.lsp.config("rust_analyzer", {
        -- capabilities = capabilities,
        settings = {
          -- ['rust-analyzer'] = {
          --   diagnostic = { enable = false },
          --   assist = { importGranularity = 'module', importPrefix = 'self' },
          --   cargo = { allFeatures = true, loadOutDirsFromCheck = true },
          --   procMacro = { enable = true },
          --   checkOnSave = { enable = true },
          --   command = { 'clippy' },
          -- },
          ["rust_analyzer"] = {
            -- enable clippy on save
            checkOnSave = {
              enable = true,
              command = "clippy", -- clippy / check
              extraArgs = { "--no-deps" },
            },
            imports = {
              granularity = {
                group = "module",
              },
              prefix = "self",
            },
            cargo = {
              allFeatures = true,
              buildScripts = {
                enable = true,
              },
            },
            procMacro = {
              enable = true,
              ignored = {
                leptos_macro = {
                  -- optional: --
                  -- "component",
                  "server",
                },
              },
            },
          },
        },
      })
      vim.lsp.enable "rust_analyzer"

      vim.keymap.set("n", "<leader>gq", function()
        vim.lsp.buf.format()
        -- Workaround for diagnostics disappearing when formatting with no changes
        -- https://github.com/neovim/neovim/issues/25014
        vim.diagnostic.enable()
      end, { desc = "'vim.lsp.buf.format()' Format file" })

      vim.api.nvim_create_autocmd("LspAttach", {
        group = vim.api.nvim_create_augroup("UserLspConfig", { clear = false }),
        callback = function(ev)
          -- 获取服务信息
          local client = vim.lsp.get_client_by_id(ev.data.client_id)
          if client == nil then
            return
          end
          print(client.name)
          vim.lsp.completion.enable(true, ev.data.client_id, ev.buf, { autotrigger = false })
        end,
      })
    end,
  },
}
